import axios from "axios";
import { defineStore } from "pinia";
const server = axios.create({
    baseURL: 'http://localhost:3333'
})
const getpersonlist = () => {
    // 这里必须要return一个promise对象
    // return server.get('/api/list').then(res=>res.data) 这里就相当于直接返回了data值
    return server.get('/api/personlist')
}
export const useListStore = defineStore('LIST', {
    state: () => {
        return {
            personlist: {},
            items: [],
            pannellist: {}
        }
    },
    actions: {
        async getpersonlist() {
            this.personlist = await getpersonlist()
        }
    }
})